/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface AsnH extends BasicModel<AsnH> {
  djno?: string; // 送货单号
  pkCorp?: string; // 公司主键
  venId?: string; // 供应商主键
  wareId?: string; // 仓库主键
  wareName?: string; // 仓库名称
  cgId?: string; // 采购员主键
  cgName?: string; // 采购员名称
  busType?: string; // 业务流程主键
  busTypeName?: string; // 业务流程
  sumQty?: number; // 送货总数
  planArrDate?: string; // 预计到货日期
  createByName?: string; // 创建人
  arrDate?: string; // 收货时间
  arrUserId?: string; // 收货人主键
  arrUserName?: string; // 收货人名称
  arrRemarks?: string; // 收货反馈
  sumArrQty?: number; // 收货总数
  djStatuse?: string; // 单据状态
  asnCList?: any[]; // 子表列表
}

export const asnHList = (params?: AsnH | any) =>
  defHttp.get<AsnH>({ url: adminPath + '/srm/asn/vouch/asnH/list', params });

export const asnHListData = (params?: AsnH | any) =>
  defHttp.post<Page<AsnH>>({ url: adminPath + '/srm/asn/vouch/asnH/listData', params });

export const asnCListData = (params?: AsnH | any) =>
  defHttp.post<Page<AsnH>>({ url: adminPath + '/srm/asn/vouch/asnH/asnCListData', params });

export const asnHForm = (params?: AsnH | any) =>
  defHttp.get<AsnH>({ url: adminPath + '/srm/asn/vouch/asnH/form', params });

export const asnHSave = (params?: any, data?: AsnH | any) =>
  defHttp.postJson<AsnH>({ url: adminPath + '/srm/asn/vouch/asnH/save', params, data });

export const asnHDelete = (params?: AsnH | any) =>
  defHttp.get<AsnH>({ url: adminPath + '/srm/asn/vouch/asnH/delete', params });

export const asnHDisabel = (params?: AsnH | any) =>
  defHttp.get<AsnH>({ url: adminPath + '/srm/asn/vouch/asnH/disabel', params });

